#include "key.h"
#include <REGF51RC.H>


/**
 * @brief 高电平单稳态触发器
 *
 * @param flag
 * @return uint8_t
 */
uint8_t monostableTrigger(uint8_t flag)
{
    static uint8_t num = 0;
    if (flag == 1 && num == 0)
    {
        num = 10;
    }

    if (num) // 如果不是0
    {
        num--;
        return 1;
    }
    else
        return flag;
}

uint8_t readKey1()
{
    return KEY_1;
}
